/**
 * Copyright (C) 2010, DRM
 */
package com.android.drm;

import org.achartengine.ChartFactory;
import org.achartengine.GraphicalView;
import org.achartengine.chart.BarChart.Type;

import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;

import com.android.drm.util.ChartHelper;

/**
 * <p><b>CLASS:</b> com.android.drm.HitBarChartBuilder</p>
 *
 * ...........................................................................
 * <p><b>DESCRIPTION:</b><br/>
 * Bar chart for correct hits.
 * </p>
 * 
 * ...........................................................................
 * <p><b>MODIFICATION HISTORY:</b>
 * <p>[2010/08/25] michellem: Initial version.</p>
 * </p>
 * 
 * ...........................................................................
 * @author michellem
 * @since 1.0
 */

public class HitBarChartBuilder extends ChartBaseBuilder {
	private GraphicalView mChartView;
	private DRMApplication drmApplication;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.chart);
		drmApplication = (DRMApplication) this.getApplication();

		LinearLayout layout = (LinearLayout) findViewById(R.id.chart);
		mChartView = ChartFactory.getBarChartView(this, 
				ChartHelper.getFourOfNineHitBarDataset(drmApplication, getIntent().getExtras()), 
				ChartHelper.getHitBarRenderer(), Type.DEFAULT);
		layout.addView(mChartView, new LayoutParams(LayoutParams.FILL_PARENT,
				LayoutParams.FILL_PARENT));
	}
}
